package com.cash.channel.api.model.response;

import com.cash.channel.api.model.DataModel;
import com.google.common.collect.Lists;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class BankListResponse implements DataModel, Serializable {

    private List<Bank> bankList = Lists.newLinkedList();

    @Data
    class Bank implements Serializable {

        public Bank(String bankCode, String icon, String bankName) {
            this.bankCode = bankCode;
            this.icon = icon;
            this.bankName = bankName;
        }

        private String bankCode;

        private String icon;

        private String bankName;

    }

    public void addBank(String bankCode, String icon, String bankName) {
        if (this.bankList==null) {
            this.bankList = Lists.newLinkedList();
        }
        this.bankList.add(new Bank(bankCode, icon, bankName));
    }

}
